<template>
	<tn-popup v-model="showPopup" open-direction="top">
		<view class="bg-qrcode"
			style="display: flex;flex-direction: column;align-items: center;padding-top: 150px;">
			<image :src="imageSrc" mode="aspectFit" style="width: 400rpx;height: 400rpx;"/>
			<text style="padding: 30px;color: #333;font-size: large;">{{sConf.auth.nicename}}</text>
		</view>
	</tn-popup>
</template>

<script>
	import utils from '../../common/utils';
	export default {
		name: "person-qrcode-pop",
		data() {
			return {
				sConf: getApp().globalData,
				showPopup: false,				
				imageSrc: null
			};
		},
		methods: {
			open(e) {
				this.imageSrc = this.sConf.host + e
				this.showPopup = !this.showPopup;
				
				// let that = this
				// if (e) {
				// 	uni.request({
				// 		url: `https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token=${e}`,
				// 		responseType: 'arraybuffer',
				// 		method: 'POST',
				// 		data: {
				// 			"scene": 'staff=' + that.sConf.auth.id,
				// 			"page": "pages/login/login",
				// 			"check_path": false,
				// 			"env_version":'trial' // 正式版为 "release"，体验版为 "trial"，开发版为 "develop"
				// 		},
				// 		success(res) {
				// 			const arrayBuffer = new Uint8Array(res.data)
				// 			const base64 = uni.arrayBufferToBase64(arrayBuffer)
				// 			that.imageSrc = `data:image/jpeg;base64,${base64}`
				// 			console.log('QrCode is ok');
				// 		},
				// 		fail(err) {
				// 			console.log(err);
				// 		}
				// 	})
				// }

				


			}
		}
	}
</script>

<style lang="scss" scoped>
	.bg-qrcode {
		/* background: radial-gradient(circle at 7.2% 13.6%, rgb(37, 249, 245) 0%, rgb(8, 70, 218) 90%);*/
		background-color: #fff;
	}
</style>